<?php
/**
 * Loads the header for mgr pages.
 *
 * @package visioncart
 * @subpackage controllers
 */

$add = '';
if (isset($_REQUEST['shopid'])) {
	$add = '?shopid='.(int)$_REQUEST['shopid'];	
}

$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/extensions.js');
$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/visioncart.js');
$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/config.php'.$add);
$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/stores.js');
$modx->regClientCss($visionCart->config['assetsUrl'].'mgr/css/style.css');

switch($_REQUEST['action']) {
	default:
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_shops.js');
		break;
	case 'modules':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_modules.js');
		break;
	case 'categories':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_categories.js');
		break;	
	case 'options':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_options.js');
		break;
	case 'products':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_products.js');
		break;
	case 'product':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_product.js');
		break;
	case 'orders':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_orders.js');
		break;		
	case 'vieworder':
		$modx->regClientStartupScript($visionCart->config['assetsUrl'].'mgr/js/page_vieworder.js');
		break;
}

return '';